# Create a 2x3 array with numeric valuesnumeric_array <-array(c(1, 2, 3, 4, 5, 6), dim =c(2, 3))# Display the arraynumeric_array
[,1] [,2] [,3]
[1,] 1 3 5
[2,] 2 4 6
Vector, Array, List??? (4)
List: versatile data structure
can hold different data types and different length
can contain vectors, array, list or any combination
# Create a list with different types of elementsmy_list <-list(numeric_vector =c(1, 2, 3),character_vector =c("apple", "orange"),logical_vector =c(TRUE, FALSE),numeric_matrix =matrix(1:4, nrow =2),nested_list =list(a =10, b ="hello"))
Vector, Array, List??? (4)
List: versatile data structure
can hold different data types and different length
can contain vectors, array, list or any combination